﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace CardsServer.WCF
{
    public class serviceconfig
    {
        [XmlRoot("configuredServices")]
        public class ConfiguredServices
        {
            public static ConfiguredServices LoadFromFile(string filename)
            {
                if (!File.Exists(filename)) return new ConfiguredServices();

                XmlSerializer ser = new XmlSerializer(typeof(ConfiguredServices));
                using (FileStream fs = File.OpenRead(filename))
                {
                    return (ConfiguredServices)ser.Deserialize(fs);
                }
            }

            [XmlElement("service", typeof(ConfiguredService))]
            public List<ConfiguredService> Services = new List<ConfiguredService>();
        }

        public class ConfiguredService
        {
            [XmlAttribute("type")]
            public string Type;


        }

    }
}
